package tjs.styudy.mini.demo.devtools;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class DemoDevtoolsApplication {

    /**
     ** 1. 监听springboot启动事件 -> 重启
     * 事件：{@link tjs.styudy.mini.springboot.devtools.config.RestartApplicationListener#onApplicationStartingEvent(org.springframework.boot.context.event.ApplicationStartingEvent)}
     * 重启：{@link tjs.styudy.mini.springboot.devtools.config.Restarter#immediateRestart()}
     *
     ** 2. 文件监听器 -> 清理资源 -> 重启
     * 监听器：{@link tjs.styudy.mini.springboot.devtools.fileWatch.FileSystemWatcher#start(long, java.lang.String)}
     * 清理资源: {@link tjs.styudy.mini.springboot.devtools.config.Restarter#stop()}
     * 重启: {@link tjs.styudy.mini.springboot.devtools.config.Restarter#immediateRestart()}
     *
     ** 3. 自定义类加载器
     * 类加载器: {@link tjs.styudy.mini.springboot.devtools.config.RestartClassLoader#loadClass(java.lang.String, boolean)}
     *
     * 自定义退出异常：{@link tjs.styudy.mini.springboot.devtools.config.SilentExitExceptionHandler.SilentExitException}
     * 自定义退出异常-捕获：{@link tjs.styudy.mini.springboot.devtools.config.SilentExitExceptionHandler#uncaughtException(java.lang.Thread, java.lang.Throwable)}
     * */
    public static void main(String[] args) throws Exception {
        SpringApplication.run(DemoDevtoolsApplication.class, args);
    }

}
